from .Primitive import Primitive

#from vtkmodules.vtkCommonDataModel import vtkMultiBlockDataSet
#from vtkmodules.vtkFiltersCore import vtkAppendPolyData

# mesh is a group of primitives...
class Mesh():
    def __init__(self) -> None:
        super().__init__()
        self.name = "Mesh"
        self.primitives = []

    def AddPrimitive(self, prim):
        self.primitives.append(prim)


    # parse from gltf object
    def Parse(self, gltf, mesh):
        self.name = mesh.name

        for p in mesh.primitives:
            prim = Primitive()
            prim.ParseGeometry(gltf, p)             
            prim.material = p.material # material index
            self.AddPrimitive(prim)